﻿/**
 * @file   FITKAbaqusHDF5AdaptorAmplitude.h
 * @brief Abaqus HDF5 Amplitude 适配器 用于读取HDF5过程中的Amplitude解析
 * @author fulipeng (fulipengqd@yeah.net)
 * @date 2024-06-07
 */
#ifndef __FITKABAQUSHDF5ADAPTORAMPLITUDE__H__
#define __FITKABAQUSHDF5ADAPTORAMPLITUDE__H__

#include "FITKAbaqusIOHDF5API.h"
#include "FITKAbaqusHDF5AbstractAdaptor.h"
#include "FITK_Kernel/FITKCore/FITKCoreMacros.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"

ForwardDeclarNS(Interface, FITKAbaAbstractAmplitude)
ForwardDeclarNS(Interface, FITKAbaAmplitudePeriodic)
ForwardDeclarNS(Interface, FITKAbaAmplitudeTabular)
ForwardDeclarNS(Interface, FITKAbstractAmplitude)

namespace IO
{
    /**
     * @brief Amplitude（幅值）读写适配器
     * @author fulipeng (fulipengqd@yeah.net)
     * @date 2024-06-07
     */
    class FITKABAQUSIOHDF5API FITKAbaqusHDF5AdaptorAmplitude : public FITKAbaqusHDF5AbstractAdaptor
    {
    public:
        explicit FITKAbaqusHDF5AdaptorAmplitude() = default;
        ~FITKAbaqusHDF5AdaptorAmplitude() = default;
        /**
         * @brief 获取适配器数据类型名
         * @return 适配器数据类型名
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-07
         */
        QString getAdaptorClass() override;

        /**
         * @brief 适配器读取
         * @return 状态 true成功， false失败
         * fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-07
         */
        bool adaptR() override;

        /**
         * @brief 适配器写出
         * @return 状态 true成功， false失败
         * fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-07
         */
        bool adaptW() override;

        /**
         * @brief 读取幅值
         * @param amplitude 幅值
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-07-01
         */
        bool readAmplitude(Interface::FITKAbaAbstractAmplitude* amplitude, H5::Group& h5Group);

        /**
         * @brief 读取幅值
         * @param amplitude 幅值
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-07-01
         */
        bool readAmplitudePeriodic(Interface::FITKAbaAbstractAmplitude* amplitude, H5::Group& h5Group);

        /**
         * @brief 读取幅值
         * @param amplitude 幅值
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-07-01
         */
        bool readAmplitudeTabular(Interface::FITKAbaAbstractAmplitude* amplitude, H5::Group& h5Group);

        /**
         * @brief 写出幅值
         * @param amplitude 幅值
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-07-01
         */
        bool writeAmplitude(Interface::FITKAbaAbstractAmplitude* amplitude, H5::Group& h5Group);

        /**
         * @brief 写出幅值 Periodic
         * @param amplitude 幅值
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-07-01
         */
        bool writeAmplitudePeriodic(Interface::FITKAbaAbstractAmplitude* amplitude, H5::Group& h5Group);

        /**
         * @brief 写出幅值 Tabular
         * @param amplitude 幅值
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-07-01
         */
        bool writeAmplitudeTabular(Interface::FITKAbaAbstractAmplitude* amplitude, H5::Group& h5Group);
    };

    Register2FITKIOAdaptorFactory(HDF5, Interface::FITKAbstractAmplitude, FITKAbaqusHDF5AdaptorAmplitude)

}

#endif
